Add PDF support for token counting#4
Open
Butanium wants to merge 1 commit intofreshfriedfish:mainfrom
Open
Conversation
- Created /api/pdf route to handle PDF token counting using Anthropic's document content blocks - Updated tokenComponents.tsx to add PDF upload UI with file validation (32MB limit) - Added PDF-to-base64 conversion and API integration - Updated TokenMetrics component to display PDF token information - Supports PDFs up to 32MB and 100 pages as per Anthropic's API limits Fixes freshfriedfish#3 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Author
Author
|
(solves #3 ) |
Author
|
@shaf-manzur any reason why you removed support for images? c2da9bf |
Owner
|
Hi! Sorry for the delay, been a bit swamped IRL. I've removed image support because I'd like this project to have a vibe similar to OpenAI's tokenizer. There are already other projects which support image and PDF uploads. I'd prefer to keep this project focused on just text. |
Owner
|
Quick update on this: after thinking about it a bit more, I've changed my mind. I'll be adding back image support and merging this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #3
🤖 Generated with Claude Code